//
//  SearchViewController.m
//  ForengnMenu
//
//  Created by wenzhaoxu on 16/1/18.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "SearchViewController.h"

@interface SearchViewController ()

@end

@implementation SearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UIButton * rightBnt = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBnt setTitle:@"搜索" forState:UIControlStateNormal];
    [rightBnt setTitleColor:[UIColor colorWithRed:248/255.0f green:102/255.0f blue:79/255.0f alpha:1.0f] forState:UIControlStateNormal];

    rightBnt.titleLabel.font = [UIFont systemFontOfSize:16];
    
    rightBnt.frame = CGRectMake(0, 0, 40, 30);
    
    [rightBnt addTarget:self action:@selector(searchBar) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBnt];
    
    UISearchBar * search = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
    
    [search setPlaceholder:@"搜索"];
    
    [search setBarStyle:UIBarStyleBlack];
    
    [search setBackgroundImage:[UIImage new]];
    
    self.navigationItem.titleView = search;
    
    self.view.backgroundColor = [UIColor colorWithRed:246/255.0f green:247/255.0f blue:239/255.0f alpha:1.0f];

}

-(void)searchBar{


}

@end
